%plot the regret/epsilon error
function  plotconv1(dir,m,prefs,exp)
data1=load(strcat(dir,'\m',int2str(m),'_n2_d2_',prefs,'.all.results'));
data2=load(strcat(dir,'\m',int2str(m),'_n3_d2_',prefs,'.all.results'));
data3=load(strcat(dir,'\m',int2str(m),'_n5_d2_',prefs,'.all.results'));
data4=load(strcat(dir,'\m',int2str(m),'_n10_d2_',prefs,'.all.results'));
data5=load(strcat(dir,'\m',int2str(m),'_n2_d3_',prefs,'.all.results'));
data6=load(strcat(dir,'\m',int2str(m),'_n2_d5_',prefs,'.all.results'));
data7=load(strcat(dir,'\m',int2str(m),'_n2_d10_',prefs,'.all.results'));
num=length(data1);
numblocks=data1(num,2)+1;

col=10;
range=[exp*numblocks+1:exp*numblocks+numblocks];
x=[0:numblocks-1]*100;
y=[data1(range,col),data2(range,col),data3(range,col),data4(range,col),data5(range,col),data6(range,col),data7(range,col)];
e=[data1(range,col+1),data2(range,col+1),data3(range,col+1),data4(range,col+1),data5(range,col+1),data6(range,col+1),data7(range,col+1)];

%a1 = x0:(x1-x0)/10:x1;

%for a1=.4
%g=1.5
lw=2;
fs=12;

set(gca,'FontSize',fs);
plot(x,y,'LineWidth', lw);
title('Epsilon Nash Convergence');
legend('n=2,d=2','n=3,d=2', 'n=5,d=2','n=10,d=2','n=2,d=3','n=2,d=5','n=2,d=10');
hold on;
xlabel('iteration', 'FontSize', fs);
ylabel('epsilon', 'FontSize', fs);

%errorbar(x,y(:,1),e(:,1),'rs');
%errorbar(x,y(:,2),e(:,2),'rs');
%errorbar(x,y(:,3),e(:,3),'rs');
%errorbar(x,y(:,4),e(:,4),'rs');
%errorbar(x,y(:,5),e(:,5),'rs');
%errorbar(x,y(:,6),e(:,6),'rs');
hold off;
xlim([0 4000]);
name = strcat('./sim_m',int2str(m),'_e',int2str(exp),'_',prefs);
print('-depsc',strcat(name, '.eps'));
%print('-dpdf',strcat(name, '.pdf'));

end

